[Internal Testing] Promote Gemini 3.1 Flash Lite to GA and support Gemini 3.5 Flash#27704
Conversation
|
📊 PR Size: size/XL
|
🛑 Action Required: Evaluation ApprovalSteering changes have been detected in this PR. To prevent regressions, a maintainer must approve the evaluation run before this PR can be merged. Maintainers:
Once approved, the evaluation results will be posted here automatically. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request unifies model management by promoting Gemini 3.1 Flash Lite to GA and introducing support for Gemini 3.5 Flash. It enhances the routing infrastructure, policy chains, and terminal UI to handle these new models dynamically based on user permissions and experimental flags, ensuring a seamless and configurable experience for users. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
Size Change: +3.09 kB (+0.01%) Total Size: 34.1 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for Gemini 3.5 Flash GA, retires Gemini 3.1 Flash Lite preview models, and updates model configurations, routing strategies, and UI displays accordingly. Two high-severity issues were identified in the review: first, hasGemini35FlashGAAccess mutates global module-level variables, introducing potential race conditions in concurrent environments; second, the DEFAULT_GEMINI_MODEL option in ModelDialog.tsx is missing its value property, which will break duplicate filtering.
| if (hasAccess) { | ||
| // Gemini API key users should have the ability to manually select the | ||
| // old preview flash model. | ||
| if (authType === AuthType.USE_GEMINI) { | ||
| setFlashModels('gemini-3-flash-preview', 'gemini-3.5-flash'); | ||
| } else { | ||
| setFlashModels('gemini-3-flash', 'gemini-3-flash'); | ||
| } | ||
| } else { | ||
| setFlashModels('gemini-3-flash-preview', 'gemini-2.5-flash'); | ||
| } |
There was a problem hiding this comment.
The method hasGemini35FlashGAAccess is a query/checker method, but it has a major side effect of mutating global module-level variables (PREVIEW_GEMINI_FLASH_MODEL and DEFAULT_GEMINI_FLASH_MODEL via setFlashModels). This violates the design principle of keeping query methods side-effect free, and more importantly, introduces a race condition in concurrent environments (such as concurrent test runs or multi-session server environments) where different sessions will overwrite each other's global model definitions.
To resolve this, avoid using module-level global variables for session-specific state. Instead, keep the resolved model mappings instance-scoped (e.g., as properties on the Config class or resolved dynamically using the instance context).
References
- Avoid module-level global variables for state to prevent race conditions and memory issues in concurrent environments. Instead, use session-scoped or instance-scoped state.
| title: getDisplayString(DEFAULT_GEMINI_MODEL), | ||
| key: DEFAULT_GEMINI_MODEL, | ||
| }, |
There was a problem hiding this comment.
The option object for DEFAULT_GEMINI_MODEL is missing the value property. Because options.filter (line 304) checks option.value to filter out duplicates, having value as undefined will cause unexpected behavior and potential filtering bugs when multiple options lack a value property.
value: DEFAULT_GEMINI_MODEL,
title: getDisplayString(DEFAULT_GEMINI_MODEL),
key: DEFAULT_GEMINI_MODEL,
},
Summary
This commit merges and unifies three separate lines of changes onto the release branch:
gemini-3.1-flash-lite-preview/none) with the stablegemini-3.1-flash-liteGA model and updates the default auto-routing and policy chains to use it as the main lightweight fallback/utility tier.GEMINI_3_5_FLASH_GA_LAUNCHED) and backend capability switches to transition users over to Gemini 3.5 Flash when experiment flag values are present.gemini-3-flash-preview.Details
1. Core Model Configurations & Resolutions (
packages/core/src/config/)PREVIEW_GEMINI_FLASH_LITE_MODELas deprecated ('none') and promotedDEFAULT_GEMINI_FLASH_LITE_MODEL('gemini-3.1-flash-lite') to GA.DEFAULT_GEMINI_3_5_FLASH_MODEL('gemini-3.5-flash') andSECONDARY_GEMINI_3_5_FLASH_MODEL('gemini-3-flash').resolveModelandresolveClassifierModelto dynamically route alias strings (auto,pro,flash) depending on user preview permissions and 3.5 Flash experiment access flags.auto-gemini-3,auto-gemini-2.5,flash) using conditional contexts matchinguseGemini3_5FlashandhasAccessToPreview.flashandprotiers that resolve cleanly togemini-3.5-flashorgemini-3-flash-previewbased on user flags.hasGemini35FlashGAAccess()to probe runtime experiments and configure default flash models (setFlashModels).getReleaseChannel()helper mapping back to the standard version channel.2. Policy Chains & Fallback Mechanics (
packages/core/src/availability/)resolvePolicyChain) to dynamically check foruseGemini3_5Flashflags.getModelPolicyChaintemplates to conditionally loadproModeloverrides based on the 3.5 Flash GA launch settings.3. Routing Strategies (
packages/core/src/routing/strategies/)approvalModeStrategy,classifierStrategy,gemmaClassifierStrategy,numericalClassifierStrategy,overrideStrategy) to pass theuseGemini3_5Flashaccess context into all model resolution calls, ensuring aligned and predictable routing behavior across the agent workflow.4. Frontend & Terminal UI (
packages/cli/src/ui/components/)gemini-3.1-flash-lite,gemini-3.5-flash).none) from the selectable list.How to Validate
Do Sanity testing with Zed / Jetbrains
Pre-Merge Checklist